!******************************************************
!* Input the nodes number and the node density 
!******************************************************
!******************************************************
subroutine read_nden_nnd(ndenfile,npt)
implicit none
character*(*) ndenfile
character tmp
integer npt
integer nut,sta
call open_or_not(nut)
npt=0
open(nut,file=ndenfile,status='old')
do
  read(nut,*,iostat=sta) tmp
  if(sta.lt.0) exit
  npt=npt+1
enddo
close(nut)
end subroutine
!******************************************************
subroutine read_nden_den(ndenfile,n_node,x_mod,y_mod,z_mod,den_mod)
implicit none
character*(*) ndenfile
character tmp
integer n_node
integer i
integer nut,sta
real*8 x_mod(n_node),y_mod(n_node),z_mod(n_node),den_mod(n_node)
call open_or_not(nut)
open(nut,file=ndenfile,status='old')
do i=1,n_node
  read(nut,*) x_mod(i),y_mod(i),z_mod(i),den_mod(i)
enddo
end subroutine
!******************************************************